Skip to content

fix(server,docs): reject gVisor + networkPolicy and document egress sidecar incompatibility#1070

Open
Pangjiping wants to merge 2 commits into
mainfrom
fix/gvisor-egress-compat-934
Open

fix(server,docs): reject gVisor + networkPolicy and document egress sidecar incompatibility#1070
Pangjiping wants to merge 2 commits into
mainfrom
fix/gvisor-egress-compat-934

Conversation

@Pangjiping

Copy link
Copy Markdown
Collaborator

Summary

Closes #934

  • Add ensure_egress_runtime_compatible() validator that returns HTTP 400 when networkPolicy is requested under secure_runtime.type=gvisor (gVisor lacks iptables nat table required by the egress sidecar's DNS redirect)
  • Wire validation into both K8s and Docker _ensure_network_policy_support() paths
  • Log startup warning when gVisor + egress image configured together
  • Add iptables nat table (egress sidecar) row to compatibility matrix in docs/secure-container.md
  • Add troubleshooting entry for egress sidecar + gVisor CrashLoopBackOff
  • Add "Runtime Compatibility" section to docs/network-isolation-for-kubernetes.md
  • Add gVisor + egress e2e test case (skips when EGRESS_IMG not set)

Test plan

  • uv run pytest tests/ — 1145 passed
  • ruff check — all checks passed
  • E2E: EGRESS_IMG=opensandbox/egress:v1.0.12 go test ./test/e2e_runtime/gvisor/... on a gVisor-enabled cluster

🤖 Generated with Claude Code

…idecar incompatibility (#934)

gVisor's netstack does not implement the iptables nat table, which the
egress sidecar requires for DNS redirect. This caused silent
CrashLoopBackOff when operators combined secure_runtime.type=gvisor
with network_policy.

- Add ensure_egress_runtime_compatible() validator that returns HTTP 400
  when networkPolicy is requested under gVisor runtime
- Wire validation into both K8s and Docker _ensure_network_policy_support()
- Log startup warning when gVisor is configured alongside egress image
- Add iptables nat row to compatibility matrix in docs/secure-container.md
- Add troubleshooting entry for egress sidecar + gVisor failure
- Add runtime compatibility section to docs/network-isolation-for-kubernetes.md
- Add gVisor + egress e2e test case in kubernetes/test/e2e_runtime/gvisor/

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Pangjiping Pangjiping added bug Something isn't working documentation Improvements or additions to documentation component/server labels Jun 15, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dc8bf3ab1b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread server/opensandbox_server/services/k8s/kubernetes_service.py
…r+egress check

Template-provided runtimeClassName bypassed the gVisor+egress validation
because the check ran against secure_runtime config before the template
merge. Now validate the assembled pod spec's runtimeClassName in each
provider after merge_with_runtime_values, catching gVisor regardless of
whether it came from config or template.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c50d35f74b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread server/opensandbox_server/services/validators.py

@fengcone fengcone left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working component/server documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the egress sidecar work under runtimeClassName: gvisor (or document the incompatibility)

3 participants